<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url><loc><%= Routes.website_url(@conn, :index) %></loc><lastmod>2023-01-08</lastmod></url>
  <url><loc><%= Routes.website_url(@conn, :use_cases_index) %></loc><lastmod>2023-01-20</lastmod></url>
  <%= for use_case <- Azimutt.showcase_usages do %>
  <url><loc><%= Routes.website_url(@conn, :use_cases_show, use_case.id) %></loc><lastmod>2023-01-20</lastmod></url>
  <% end %>
  <url><loc><%= Routes.website_url(@conn, :features_index) %></loc><lastmod>2023-03-10</lastmod></url>
  <%= for feature <- Azimutt.showcase_features do %>
  <url><loc><%= Routes.website_url(@conn, :features_show, feature.id) %></loc><lastmod>2023-03-10</lastmod></url>
  <% end %>
  <url><loc><%= Routes.website_url(@conn, :pricing) %></loc><lastmod>2023-03-10</lastmod></url>
  <url><loc><%= Routes.website_url(@conn, :aml) %></loc><lastmod>2024-09-29</lastmod></url>

  <url><loc><%= Routes.website_url(@conn, :connectors) %></loc><lastmod>2024-10-15</lastmod></url>
  <url><loc><%= Routes.website_url(@conn, :connector_new) %></loc><lastmod>2024-10-15</lastmod></url>
  <%= for connector <- Azimutt.connectors() do %>
  <url><loc><%= Routes.website_url(@conn, :connector, connector.id) %></loc><lastmod><%= connector[:mod] || connector[:pub] || "2024-10-15" %></lastmod></url>
  <% end %>

  <url><loc><%= Routes.website_url(@conn, :converters) %></loc><lastmod>2024-09-29</lastmod></url>
  <%= for parser <- Azimutt.converters() |> Enum.filter(fn c -> c.parse end) do %>
  <url><loc><%= Routes.website_url(@conn, :converter, parser.id) %></loc><lastmod>2024-09-29</lastmod></url>
  <%= for generator <- Azimutt.converters() |> Enum.filter(fn c -> c.generate end) do %>
  <url><loc><%= Routes.website_url(@conn, :convert, parser.id, generator.id) %></loc><lastmod>2024-09-29</lastmod></url>
  <% end %>
  <% end %>

  <url><loc><%= Routes.website_url(@conn, :comparisons) %></loc><lastmod>2024-11-15</lastmod></url>
  <%= for category <- Azimutt.comparisons() do %>
  <%= for tool <- category.tools do %>
  <url><loc><%= Routes.website_url(@conn, :comparison, category.id, tool.id) %></loc><lastmod><%= tool[:mod] || tool.pub %></lastmod></url>
  <% end %>
  <% end %>

  <url><loc><%= Routes.website_url(@conn, :docs) %></loc><lastmod>2024-10-07</lastmod></url>
  <%= for doc <- Azimutt.doc_pages_flat() do %>
  <url><loc><%= Routes.website_url(@conn, :doc, doc.path) %></loc><lastmod><%= doc[:mod] || doc[:pub] || "2024-10-07" %></lastmod></url>
  <% end %>

  <%= if length(@articles) > 0 do %>
  <url>
    <loc><%= Routes.blog_url(@conn, :index) %></loc>
    <lastmod><%= Enum.max_by(@articles, & &1.published, Date).published %></lastmod>
    <changefreq>weekly</changefreq>
  </url>
  <% end %>
  <%= for article <- @articles do %>
  <url>
    <loc><%= Routes.blog_url(@conn, :show, article) %></loc>
    <lastmod><%= article.published %></lastmod>
  </url>
  <% end %>

  <%= if length(@samples) > 0 do %>
  <url>
    <loc><%= Routes.gallery_url(@conn, :index) %></loc>
    <lastmod><%= Enum.max_by(@samples, & &1.updated_at, Date).updated_at |> Timex.format!("{YYYY}-{0M}-{0D}") %></lastmod>
    <changefreq>weekly</changefreq>
  </url>
  <% end %>
  <%= for sample <- @samples do %>
  <url>
    <loc><%= Routes.gallery_url(@conn, :show, sample.slug) %></loc>
    <lastmod><%= sample.updated_at |> Timex.format!("{YYYY}-{0M}-{0D}") %></lastmod>
  </url>
  <% end %>
</urlset>
